package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {
    List<Category> page(String name, Integer type);

    @AutoFill(value = OperationType.INSERT)
    void insert(Category category);

    @AutoFill(value = OperationType.UPDATE)
    void status(Category category);


    void delete(Long id);

    Category byid(Long id);

    @Select("select name from category where id = #{categoryId};")
    String selectByName(Long categoryId);

    List<Category> list(Integer type);
}
